package 数组.练习;

import java.util.Scanner;

public class FindElement666 {
    public static void main(String[] args) {
        int[][] array={{1,2,8,9},
                {2,4,9,12},
                {4,7,10,13},
                {6,8,11,15}};
        //###补充代码###
        Scanner sc=new Scanner(System.in);
        System.out.println("input:");
        int x=sc.nextInt();
        boolean flag=false;
        int hang=0,lie=3;
        while(true){
            if(hang>3||lie<0){
                break;
            }
            if(x==array[hang][lie]){
                flag=true;
                break;
            }else if(x>array[hang][lie]){
                hang++;
            }else{
                lie--;
            }
        }
        System.out.println(flag);
    }
}
